{#
 # ---------------------------------------------------------------------
 #
 # GLPI - Gestionnaire Libre de Parc Informatique
 #
 # http://glpi-project.org
 #
 # @copyright 2015-2025 Teclib' and contributors.
 # @licence   https://www.gnu.org/licenses/gpl-3.0.html
 #
 # ---------------------------------------------------------------------
 #
 # LICENSE
 #
 # This file is part of GLPI.
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
 #
 # ---------------------------------------------------------------------
 #}

{% extends "layout/page_without_tabs.html.twig" %}

{% set container_size = "narrow" %}

{% block content_title %}
    {{ __('Import forms') }}
{% endblock content_title %}

{% block content_body %}
    <div class="card">
        <div class="card-header py-3 px-4">
            <h3 class="card-title">{{ __("Import results") }}</h3>
        </div>
        <table class="table table-card mb-0">
            <thead>
                <tr>
                    <th class="w-70 px-4">{{ "Glpi\\Form\\Form"|itemtype_name }}</th>
                    <th class="w-30 px-4">{{ __("Status") }}</th>
                </tr>
            </thead>
            <tbody>
                {% for form in results.getImportedForms() %}
                    <tr>
                        <td class="w-70 px-4">{{ get_item_link(form) }}</td>
                        <td class="w-30 px-4">
                            <div class="d-flex align-items-center">
                                <i class="ti ti-check text-success me-2"></i>
                                <span>{{ __("Imported") }}</span>
                            </div>
                        </td>
                    </tr>
                {% endfor %}
                {% for forms_name, error in results.getFailedFormImports() %}
                    <tr>
                        <td class="w-70 px-4">{{ forms_name }}</td>
                        <td class="w-30 px-4">
                        <div class="d-flex align-items-center">
                                <i class="ti ti-x text-danger me-2"></i>
                                <span>{{ __("Not imported") }}</span>
                            </div>
                        </td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>

    <div class="row mt-3">
        <div class="col">
            <div class="justify-content-end d-flex">
                <a href="{{ path('/Form/Import') }}" class="btn btn-outline-secondary">
                    {{ __("Import another file") }}
                </a>
            </div>
        </div>
    </div>
{% endblock content_body %}

